package com.xinruke.hostels.reservation.controller.pms;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.common.vo.query.RowsDataVO;
import com.xinruke.hostels.reservation.interfaces.dto.*;
import com.xinruke.hostels.reservation.interfaces.dto.pms.RestaurantDetailPmsQueryDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.RestaurantDetailPmsQueryResultDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.RestaurantListPmsQueryDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.RestaurantListPmsQueryResultDto;
import com.xinruke.hostels.reservation.service.RestaurantOrderService;
import com.xinruke.hostels.reservation.service.pms.RestaurantBookingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author Chenry
 * @ClassName RestaurantBookingController
 * @date：2019/8/10
 * @version: V1.0.0
 * @description：餐厅预订
 */
@RestController
@RequestMapping("/restaurant/booking")
@Api(tags = "餐厅预订管理")
public class RestaurantBookingController extends BaseController {

    @Resource
    private RestaurantBookingService restaurantBookingService;


    /**
     * 订单查询列表
     *
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("订单查询列表")
    public ResultVO<RowsDataVO<RestaurantListPmsQueryResultDto>> list(@Valid @RequestBody RestaurantListPmsQueryDto params) {
        ResultVO<RowsDataVO<RestaurantListPmsQueryResultDto>> resultVO = ResultVO.success();
        RowsDataVO<RestaurantListPmsQueryResultDto> list = restaurantBookingService.list(params);
        resultVO.setData(list);
        return resultVO;
    }


    /**
     * 订单详情
     *
     * @return
     */
    @PostMapping("/detail")
    @ApiOperation("订单详情")
    public ResultVO<RestaurantDetailPmsQueryResultDto> orderDetail(@Valid @RequestBody RestaurantDetailPmsQueryDto params) {
        return restaurantBookingService.detail(params);
    }

}
